package com.meida.module.bus.provider.handler;

import com.meida.common.base.entity.EntityMap;
import com.meida.common.mybatis.interceptor.GetInterceptor;
import com.meida.common.mybatis.query.CriteriaQuery;
import com.meida.module.bus.client.entity.BusOrder;
import com.meida.module.bus.client.entity.BusOrderAppraise;
import com.meida.module.user.client.entity.AppUser;
import org.springframework.stereotype.Component;

/**
 * 订单评价详情
 *
 * @author zyf
 */
@Component
public class BusOrderAppraiseGetHandler implements GetInterceptor {


    @Override
    public void prepare(CriteriaQuery cq, EntityMap entityMap) {
        cq.clear();
        cq.select(BusOrderAppraise.class, "appraiseId", "orderId", "appraiseUserId", "answerUserId", "score","appraiseContent", "createTime");
        cq.select(AppUser.class, "nickName","userName");
        cq.select(BusOrder.class, "orderNo");
        cq.eq(BusOrderAppraise.class, "appraiseId");
        cq.createJoin(BusOrder.class).setMainField("orderId").setJoinField("orderId");
        cq.createJoin(AppUser.class).setMainField("appraiseUserId").setJoinField("userId");
    }


}
